<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>2-根据ID获取元素</title>
		<style type="text/css">
			#box{
				
			}
		</style>
	</head>
	<body>
		<div id="box">百度</div>
		<script type="text/javascript">
			//语法：document.getElementById(id)
			//如果有元素，则返回元素对象否则null
			//document表示文档，它就是一个页面
			var box = document.getElementById('box');
			console.log(box);//{}
			var email = document.getElementById('email');
			console.log(email);
			
		</script>
	</body>
</html>
